<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>主页</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <!--weui.min.css-->
    <link rel="stylesheet" href="/static/index/css/page/base.css"/>
    <link rel="stylesheet" href="/static/index/css/page/font.css"/>
    <link rel="stylesheet" href="/static/index/jquery_weui/css/swiper.min.css"/>
    <link rel="stylesheet" type="text/css" href="/static/index/jquery_weui/lib/weui.min.css">
    <!--jquery-weui.min.css-->
    <link rel="stylesheet" type="text/css" href="/static/index/jquery_weui/css/jquery-weui.min.css">
    <link rel="stylesheet" href="/static/index/css/page/index.css" />
    <style>
        .start{
        	position: fixed;
        	top: 0;
        	left: 0;
        	right: 0;
        	bottom: 0;
        	/*background: #f5f2e3;*/
        	width: 100%;
            z-index: 10000;
		    text-align: center;
		    display: flex;
		    flex-direction: column;
		    justify-content: center;
        }
    	.start img{
    		margin:0 auto;
    		padding:0;
		    width:100%;
		    height: auto;
    	}
    	.lunbo a img{
    		width:100%;
    		height:13rem;
    	}
    	.noteMemo .weui-cell__bd>a{
    		margin: .2rem 0;
    	
    	}
    	.noteMemo .weui-cell__bd{
    		padding: .2rem 0;
    		height: 1.5rem;
    		overflow: hidden;
    	}
    	
    	.weui-popup__overlay{
    		background: #7e7e7e;
    		opacity: .5;
    	}
    	.weui-popup__modal{
    		bottom: auto;
    		width: 70%;
    		background: #fff;
    		top: 40%;
    		left: 9%;
    		padding: 6%;
    		border-radius: 7px;
    	}
    	.noteMemo-btn>a{
    		margin: .3rem;
    	}
    	/*图片处理css*/
    	.list2 .swiper-slide>a{
    		overflow: hidden;
    		position: relative;
    	}
    	.list2 .swiper-slide>a img{
    		
    		position: absolute;
    		left: 50%;
    		top: 50%;
    	}
        .weui-popup__container {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            width: 100%;
            height: 100%;
            z-index: 10000000000;
        }
    </style>
</head>
<body>


<div class="pageControl index" id="index">
    <div class="zhe1"></div>
    <div class="zhe"></div>

    <div class="nav">
        <div class="msui_navTop">
            <!--<div class="test"></div>-->
            <a class="msui_navTop-back" href="/index/personal/personal"><i class="micon-home"></i></a>
            <!--{if $user_id}
            <span class="today">签到领取鲜花</span>
            {/if}-->
            <div class="index-sou">
                <div class="weui-search-bar" id="searchBar">
                    <form class="weui-search-bar__form">
                        <div class="weui-search-bar__box">
                            <i class="weui-icon-search"></i>
                            <input type="search" class="weui-search-bar__input" id="searchInput" placeholder="搜索" required="">
                            <a href="javascript:" class="weui-icon-clear" id="searchClear"></a>
                        </div>
                        <label class="weui-search-bar__label" id="searchText">
                            <i class="weui-icon-search"></i>
                            <span>搜索</span>
                        </label>
                    </form>
                </div>
            </div>
            <a class="msui_navTop-icon" href="/index/index/message">
                <i class="micon-message2"></i>
                {if $count gt 0 || $start_count gt 0 || $quit_count gt 0 || $quit_count2 gt 0 || $report_count gt 0}
                <span class="weui-badge weui-badge_dot"></span>
                {/if}
            </a>
        </div>
    </div>
    <div class="index-top">
        <div class="swiper-container1">
            <div class="swiper-wrapper">
				{foreach name="pic" item="vo"}
                    <div class="swiper-slide lunbo">
                        <a href="/index/index/article?id={$vo.id}"><img src="{$vo.pic}" alt=""/></a>
                    </div>
                {/foreach}
        		<!--<img src="../static/images/idx.png" alt=""/>-->
            </div>
        </div>
        <div class="swiper-pagination swiper-pagination-bullets swiper-pagination-hidden"></div>
        
        <div class="index-top-tab">
            <div class="index-tab">
                {foreach name="cate_info" item="vo"}
                <a {if $vo.cate_name eq '电竞邀约'}class="active"{/if} href="{$vo.id}"><span class="index-tab_bg"></span><span class="index-tab_title">{$vo.cate_name}</span></a>
                {/foreach}
            </div>
        </div>
    </div>
    <div class="personal-list">
        <div data-value="1" class="tab mr-bottom25" style="z-index:5;">

            {foreach name="city_info" item="vo"}
            <div class="list t0">
                <div class="weui-cell list1">
                	{if $user_id neq $vo.uid}
	                    <div class="weui-label">
	                    	{if $vo.img}
                                <a href="javascript:;" class="other_href"><img src="{$vo.img}" alt=""/></a>
	                        {else}
                                <a href="javascript:;" class="other_href"> <img src="/static/index/images/head.png" alt=""/></a>
                            {/if}
                            <input type="hidden" value="{$vo.uid}">
	                    </div>
                    {else}
	                    <div class="weui-label">
	                    	{if $vo.img}
	                        <a href="javascript:;"> <img src="{$vo.img}" alt=""/></a>
	                        {else}
	                        <a href="javascript:;"> <img src="/static/index/images/head.png" alt=""/></a>
	                    	{/if}
	                    </div>
                    {/if}
                    <div class="weui-cell__bd">
                        <div>
                        	{$vo.name}
                        </div>
                        <div class="list-age">
                            <p class="">
                                {if $vo.sex eq 1}<img src="/static/index/images/n1.png" alt=""/>{else}<img src="/static/index/images/n0.png" alt=""/>{/if}
                                <span   class="cl-47c">{$vo.age}岁</span>
                            </p>
                            <p class="">
                                {if $vo.is_rz eq 1}<img src="/static/index/images/x0.png" alt=""/>{/if}
                                <span  class="cl-fc8">{if $vo.is_rz eq 0}未认证{elseif $vo.is_rz eq 2}待审核{else}已认证{/if}</span>
                            </p>
                            <p class="bg-ff7" style="float:right">
                            	{if $vo.pay_type eq 1}
                                <span>我买单</span>
                                {else}
                                <span>AA制</span>
                                {/if}
                            </p>
                        </div>
                    </div>
                    <div class="weui-cell__ft">
                        <p>{$vo.create_time}</p>
                    </div>
                </div>
                <div class="list2">
                    <p class="list2-a"><span class="cl-26c">{$vo.go_time}</span>{$vo.content}</p>
                    <div class="swiper-container">
                        <div class="swiper-wrapper">
                        	<?php $ssh = explode("|",$vo['photo']);?>
                            {foreach name="ssh" item="city_photo"}
	                            <div class="swiper-slide">
	                                <a href="/index/index/detail?id={$vo.id}&uid={$vo.uid}"><img src="{$city_photo}" alt=""/></a>
	                            </div>
                            {/foreach}
                        </div>
                        <div class="pic-count"><?php echo count($ssh)?>张</div>
                    </div>
                    <div class="weui-cell1">
                        <div class="weui-cell__bd">
                            <!--<img src="/static/index/images/x1.png" alt=""/>
                            <span class="cl-9999">{$vo.address}</span>-->
                        </div>
                        <div class="weui-cell__ft">
                            <img src="/static/index/images/x2.png" alt=""/>
                            <span>{$vo.count}</span>
                        </div>
                        <div class="weui-cell__ft">
                            <img src="/static/index/images/x3.png" alt=""/>
                            <span>{$vo.comment_count}</span>
                        </div>
                    </div>
                    <div class="weui-cell1 noteMemo1">
                        <div class="weui-cell__bd index-btn1">
                            <img src="/static/index/images/x4.png" alt=""/>
                              {foreach name="vo.tag_id" item="tags"}
                              	{if $tags.id lt 99}
                        			<a href="/index/index/search_result?tag_id={$tags.id}" class="bg-27c cl-f note-list">{$tags['tag']}</a>
                        		{else}
                        			<a href="/index/index/search_result?tag_id={$tags['tag']}" class="bg-27c cl-f note-list">{$tags['tag']}</a>
                        		{/if}
                              {/foreach}
                            <a class="moretag bg-27c cl-f groupb  note-more" href="javascript:;" data-target='#noteMemo3'>更多<input type="hidden" class="agroup" value="{$vo['id']}"/>
                                <input type="hidden" class="cate" value="{$vo.cate_id}"/>
                            </a>
                        </div>
                    </div>
                </div>
            </div>
            {/foreach}

        </div>
        <div data-value="2" class="tab active1 mr-bottom25" style="z-index: 9;">
        	{foreach name="game_info" item="vo"}
            <div class="list t0">
                <div class="weui-cell list1">
                    {if $user_id neq $vo.uid}
	                    <div class="weui-label">
	                    	{if $vo.img}
	                        <a href="javascript:;" class="other_href"> <img src="{$vo.img}" alt=""/></a>
                            {else}
	                        <a href="javascript:;" class="other_href"> <img src="/static/index/images/head.png" alt=""/></a>
	                        {/if}
                            <input type="hidden" value="{$vo.uid}">
	                    </div>
                    {else}
	                    <div class="weui-label">
	                    	{if $vo.img}
	                        <a href="javascript:;"> <img src="{$vo.img}" alt=""/></a>
	                        {else}
	                        <a href="javascript:;"> <img src="/static/index/images/head.png" alt=""/></a>
	                        {/if}
	                    </div>
                    {/if}
                    <div class="weui-cell__bd">
                        <div>{$vo.name}</div>
                        <div class="list-age">
                            <p class="">
                                {if $vo.sex eq 1}<img src="/static/index/images/n1.png" alt=""/>{else}<img src="/static/index/images/n0.png" alt=""/>{/if}
                                <span  class="cl-47c">{$vo.age}岁</span>
                            </p>
                            <p class="">
                                {if $vo.is_rz eq 1}<img src="/static/index/images/x0.png" alt=""/>{/if}
                                <span  class="cl-fc8">{if $vo.is_rz eq 0}未认证{elseif $vo.is_rz eq 2}待审核{else}已认证{/if}</span>
                            </p>
                            <p class="bg-ff7" style="float:right">
                            	{if $vo.pay_type eq 1}
                                <span>我买单</span>
                                {else}
                                <span>AA制</span>
                                {/if}
                            </p>
                        </div>
                    </div>
                    <div class="weui-cell__ft">
                        <p>{$vo.create_time}</p>
                    </div>
                </div>
                <div class="list2">
                    <p class="list2-a"><span class="cl-26c">{$vo.go_time}</span>{$vo.content}</p>
                    <!--<p class="list2-b">-- <span>阿尔伯特·爱因斯坦</span></p>-->
                    <div class="swiper-container">
                        <div class="swiper-wrapper">
                        	<?php $ssh = explode("|",$vo['photo']);?>
        					{foreach name="ssh" item="hot_photo"}
	                            <div class="swiper-slide">
	                                <a href="/index/index/detail?id={$vo.id}&uid={$vo.uid}"><img src="{$hot_photo}" alt=""/></a>
	                            </div>
                            {/foreach}

                        </div>
                        <div class="pic-count"><?php echo count($ssh)?>张</div>
                    </div>
                    <div class="weui-cell1">
                        <div class="weui-cell__bd">
                            <!--<img src="/static/index/images/x1.png" alt=""/>
                            <span class="cl-9999">{$vo.address}</span>-->
                        </div>
                        <div class="weui-cell__ft">
                            <img src="/static/index/images/x2.png" alt=""/>
                            <span>{$vo.count}</span>
                        </div>
                        <div class="weui-cell__ft">
                            <img src="/static/index/images/x3.png" alt=""/>
                            <span>{$vo.comment_count}</span>
                            
                        </div>
                    </div>
                    <div class="weui-cell1 noteMemo2">
                        <div class="weui-cell__bd index-btn1">
                            <img src="/static/index/images/x4.png" alt=""/>
                            {foreach name="vo.tag_id" item="tags"}
                            	{if $tags.id lt 99}
                        			<a href="/index/index/search_result?tag_id={$tags.id}" class="bg-27c cl-f note-list">{$tags['tag']}</a>
                        		{else}
                        			<a href="/index/index/search_result?tag_id={$tags['tag']}" class="bg-27c cl-f note-list">{$tags['tag']}</a>
                        		{/if}
                            {/foreach}
                            <a class="moretag bg-27c cl-f groupb  note-more" href="javascript:;" data-target='#noteMemo3'>
                            	更多
                            	<input type="hidden" class="agroup" value="{$vo['id']}"/>
                                <input type="hidden" class="cate" value="{$vo.cate_id}"/>
                            </a>
                        </div>
                    </div>
                </div>
            </div>
            {/foreach}

        </div>
        <div data-value="3" class="tab mr-bottom25" style="z-index: 9;">
        	{foreach name="tour_info" item="vo"}
            <div class="list t0">
                <div class="weui-cell list1">
                    {if $user_id neq $vo.uid}
	                    <div class="weui-label">
	                    	{if $vo.img}
	                        <a href="javascript:;" class="other_href"><img src="{$vo.img}" alt=""/></a>
	                        {else}
	                        <a href="javascript:;" class="other_href"> <img src="/static/index/images/head.png" alt=""/></a>
	                        {/if}
                            <input type="hidden" value="{$vo.uid}">
                        </div>
                    {else}
	                    <div class="weui-label">
	                    	{if $vo.img}
	                        <a href="javascript:;"> <img src="{$vo.img}" alt=""/></a>
	                        {else}
	                        <a href="javascript:;"> <img src="/static/index/images/head.png" alt=""/></a>
	                        {/if}
	                    </div>
                    {/if}
                    <div class="weui-cell__bd">
                        <div>
                        	{$vo.name}
                        </div>
                        <div class="list-age">
                            <p class="">
                                {if $vo.sex eq 1}<img src="/static/index/images/n1.png" alt=""/>{else}<img src="/static/index/images/n0.png" alt=""/>{/if}
                                <span   class="cl-47c">{$vo.age}岁 </span>
                            </p>
                            <p class="">
                                {if $vo.is_rz eq 1}<img src="/static/index/images/x0.png" alt=""/>{/if}
                                <span  class="cl-fc8">{if $vo.is_rz eq 0}未认证{elseif $vo.is_rz eq 2}待审核{else}已认证{/if}</span>
                            </p>
                            <p class="bg-ff7" style="float:right">
                            	{if $vo.pay_type eq 1}
                                <span>我买单</span>
                                {else}
                                <span>AA制</span>
                                {/if}
                            </p>
                        </div>
                    </div>
                    <div class="weui-cell__ft">
                        <p>{$vo.create_time}</p>
                    </div>
                </div>
                <div class="list2">
                    <p class="list2-a"><span class="cl-26c">{$vo.go_time}</span>{$vo.content}</p>
                    
                    <div class="swiper-container">
                        <div class="swiper-wrapper">
                        	<?php $ssh = explode("|",$vo['photo']);?>
        					{foreach name="ssh" item="tour_photo"}
	                            <div class="swiper-slide">
	                                <a href="/index/index/detail?id={$vo.id}&uid={$vo.uid}">
	                                	<img src="{$tour_photo}" alt="" />
	                                </a>
	                            </div>
                            {/foreach}
                        </div>
                        <div class="pic-count"><?php echo count($ssh)?>张</div>
                    </div>
                    <div class="weui-cell1">
                        <div class="weui-cell__bd">
                            <!--img src="/static/index/images/x1.png" alt=""/>
                            <span class="cl-9999">{$vo.address}</span>-->
                        </div>
                        <div class="weui-cell__ft">
                            <img src="/static/index/images/x2.png" alt=""/>
                            <span>{$vo.count}</span>
                        </div>
                        <div class="weui-cell__ft">
                            <img src="/static/index/images/x3.png" alt=""/>
                            <span>{$vo.comment_count}</span>
                        </div>
                    </div>
                    <div class="weui-cell1 noteMemo3">
                        <div class="weui-cell__bd index-btn1">
                            <img src="/static/index/images/x4.png" alt=""/>
                              {foreach name="vo.tag_id" item="tags"}
	                              {if $tags.id lt 99}
	                    			<a href="/index/index/search_result?tag_id={$tags.id}" class="bg-27c cl-f note-list">{$tags['tag']}</a>
	                    			{else}
	                    			<a href="/index/index/search_result?tag_id={$tags['tag']}" class="bg-27c cl-f note-list">{$tags['tag']}</a>
	                    		  {/if}
                              {/foreach}
                              <a class="moretag bg-27c cl-f groupb  note-more" href="javascript:;" data-target='#noteMemo3'>更多<input type="hidden" class="agroup" value="{$vo['id']}"/>
                                  <input type="hidden" class="cate" value="{$vo.cate_id}"/>
                              </a>
                        </div>
                    </div>
                </div>
            </div>
            {/foreach}

        </div>
    </div>
    </p>


    <div class="indexMessage">
        <div class="bg-di"></div>
        <div class="msui_nav msui_navTop">
            <a class="msui_navTop-back goBack" href=""><i class="micon-back"></i></a>
            <h1 class="msui_navTop-title">选择发布消息</h1>
        </div>
        <p class="f5"></p>
        <p class="friend-title">您选择将你的信息发布在</p>
        <div class="friend-flex" id="cookie">
            <a id="delete-qu"  class="f-brn bg-ff7 cl-f ">同城</a>
            <a id="" class="f-brn bg-ff7 cl-f">电竞邀约</a>
            <a id="delete-que" class="f-brn bg-ff7 cl-f">旅游</a>
        </div>
        <div class="message-date">
            <a href="" class="cl-3333">选择出行时间</a>
        </div>
        <div class="weui-cell message-date1">
            <div class="weui-cell__bd">
                <input class="weui-input time" type="text" id='datetime-picker' name="go_time"/>
            </div>
        </div>
        
        <div class="message-date">
            <a href="" class="cl-3333">选择结束时间</a>
        </div>
        <div class="weui-cell message-date1">
            <div class="weui-cell__bd">
                <input class="weui-input time end_time" type="text" id='datetime-picker2' name="end_time"/>
            </div>
        </div>
    </div>
</div>

<!--更多标签-->
<div id="noteMemo3" class="weui-popup__container popup-bottom">
  <div class="weui-popup__overlay"></div>
  <div class="weui-popup__modal index-btn1 noteMemo-btn" id="shows">

  </div>
</div>

<div class="pl">
    <div class="weui-tabbar">
        <a href="" class="weui-tabbar__item index_message">
            <div class="weui-tabbar__icon">
                <img src="/static/index/images/id1.png" alt="">
            </div>
            <p class="weui-tabbar__label cl-47c fs065">发布</p>
        </a>
        <a href="/index/personal/offered" class="offered_uid weui-tabbar__item">
            <div class="weui-tabbar__icon">
                <img src="/static/index/images/id2.png" alt="">
            </div>
            <p class="weui-tabbar__label cl-47c fs065">参团</p>
        </a>
        <a href="/index/index/search_near" class="weui-tabbar__item">
            <div class="weui-tabbar__icon">
                <img src="/static/index/images/id3.png" alt="">
            </div>
            <p class="weui-tabbar__label cl-47c fs065">附近</p>
        </a>
    </div>
</div>
<div id="allmap"></div>
<div class="start" id="logo">
    <!--<img src="/static/index/images/lv_logo1.jpg" />-->
</div>
<!-- jquery-2.1.4 -->
<script type="text/javascript" src="/static/index/jquery_weui/lib/jquery-2.1.4.js"></script>
<!-- jquery-weui.min.js -->
<script type="text/javascript" src="/static/index/jquery_weui/js/jquery-weui.min.js"></script>

<!--cookie-->
<script src="/static/index/jquery_weui/js/jquery.cookie.js"></script>
<!--获取当前位置经纬度-->
<script src="http://api.map.baidu.com/api?v=1.2" type="text/javascript"></script>
<script src="/static/index/jquery_weui/js/swiper.min.js"></script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.4"></script>
<script>
    $(function () {
        /*获取当前的位置     start*/
        function getLocation(){
            if (navigator.geolocation){
                navigator.geolocation.getCurrentPosition(showPosition);
            }else{
                x.innerHTML="Geolocation is not supported by this browser.";
            }
        }
        function showPosition(position){
            get_lat = position.coords.latitude;
            get_lng = position.coords.longitude;
            if(get_lng != 0 && get_lat != 0){
                var expiresDate= new Date();
                //60分钟为 60 * 60 *1000
                expiresDate.setTime(expiresDate.getTime() + (60 * 60 * 1000));
                $.cookie("index_lng", get_lng, {path : '/',expires : expiresDate});
                $.cookie("index_lat", get_lat, {path : '/',expires : expiresDate});
            }
        }
        if($.cookie('index_lng') == null && $.cookie('index_lat') == null){
            getLocation();
        }
        /*获取当前的位置     end*/
    })
</script>
<script>
    /*签到领取鲜花*/
    var is_qiandao = {$qiandao};

    if(is_qiandao == 0){
        //未签到
        $('.today').on('click',function () {
            $.post(
                "/index/personal/qiandao    ",
                function(data){
                    if(data.code == 1){
                        alert(data.msg);
                        $('.today').css('display','none');
                    }
                },'json'
            )
        });
    }else{
        $('.today').css('display','none');
    }


    $(function(){
        $('.other_href').on('click',function(){
            var uid = $(this).next().val();
            $.cookie('uid',uid);
            if(uid)window.location.href="/index/other/other ";
        });

        $("#logo").click(function(){
            $("#logo").hide();//隐藏logo
            $("#index").show();//显示首页内容
        });

        is_logo = $.cookie('logo');
        if(is_logo == 1){
           $("#index").show();//显示首页内容
           $("#logo").hide();//隐藏logo
        }else{
            //隐藏首页
            function hide_index(){
                $("#index").hide();
            }
            //显示首页
            function show_index(){
                $.cookie('logo','1');
                $("#index").show();
                $("#logo").remove();
            }
        }
        setTimeout(hide_index,0);
        setTimeout(show_index,3000);
    });


    $(".moretag").click(function (){
        var id= $(this).children('.agroup').val();
        var cate= $(this).children('.cate').val();
        $.ajax({
            type:'post',
            url:'/index/index/onetag',
            data:{id:id,cate:cate},
            success:function(data){
                //alert(date);
                var arr = JSON.parse(data);

                var str = "";
                for(var i=3;i<arr.length;i++){
                    if(arr[i]['id'] >99){
                        str+="<a href='/index/index/search_result?tag_id="+arr[i]['tag']+"' class='bg-27c cl-f note-list'>"+arr[i]['tag']+"</a>";
                    }else{
                        str+="<a href='/index/index/search_result?tag_id="+arr[i]['id']+"' class='bg-27c cl-f note-list'>"+arr[i]['tag']+"</a>";
                    }

                }
                $("#shows").html("");
                $("#shows").append(str);
                $("#noteMemo3").popup();
            }
        });
    });

    $(function(){
        function getNowFormatDate() {
            var date=new Date();
            var month = date.getMonth() + 1;
            var strDate = date.getDate();
            if (month >= 1 && month <= 9) {
                month = "0" + month;
            }
            if (strDate >= 0 && strDate <= 9) {
                strDate = "0" + strDate;
            }
            var currentdate = date.getFullYear() + '-' + month + '-' + strDate
                + " " + date.getHours() + ':' + date.getMinutes();
            return currentdate;
        }

        $('#datetime-picker').val(getNowFormatDate());
        $('#datetime-picker2').val(getNowFormatDate());
//		图片处理
        $('.personal-list .swiper-slide>a img').each(function(){

            var imgWidth=-parseFloat($(this).css('width'))/2;
            var imgHeight=-parseFloat($(this).css('height'))/2;

            var imgWidth1=parseFloat($(this).css('width'));
            var imgHeight1=parseFloat($(this).css('height'));
            if(imgWidth1>=imgHeight1){
                $(this).css({
                    height:'100%',
                    width:'auto'
                })
                $(this).css('top','0')
                $(this).css('margin-left',imgWidth)
            }else if(imgWidth1<imgHeight1){
                $(this).css({
                    height:'auto',
                    width:'100%'
                })
                $(this).css('margin-top',imgHeight)
                $(this).css('margin-left',imgWidth)
            }
        })


        var swiperWidth=$('.list .swiper-slide').width();
        $('.list .swiper-slide').css('height',swiperWidth)
        $('.list .swiper-slide>a img').css('min-height',swiperWidth)
        /*同城更多标签*/
        $('.noteMemo1').each(function(){
            var ttCount=$(this).find('.index-btn1 a.note-list').length;
            var listCount=$(this).find('.index-btn1 a').length;
            if(listCount>4){
                for(var i=1;i<=ttCount;i++){
                    if(i>3){
                        $(this).find(`.index-btn1 a.note-list:nth-of-type(${i})`).css('display','none')
                    }
                }
                $(this).find('.note-more').css('display','inline-block')
            }else if(listCount<=4){
                $(this).find('.note-more').css('display','none')
            }
//  console.log(listCount)
        })

        /*热门更多标签*/
        $('.noteMemo2').each(function(){
            var ttCount=$(this).find('.index-btn1 a.note-list').length;
            var listCount=$(this).find('.index-btn1 a').length;
            if(listCount>4){
                for(var i=1;i<=ttCount;i++){
                    if(i>3){
                        $(this).find(`.index-btn1 a.note-list:nth-of-type(${i})`).css('display','none')
                    }
                }
                $(this).find('.note-more').css('display','inline-block')
            }else if(listCount<=4){
                $(this).find('.note-more').css('display','none')
            }
//  console.log(listCount)
        })

        /*旅游更多标签*/
        $('.noteMemo3').each(function(){
            var ttCount=$(this).find('.index-btn1 a.note-list').length;
            var listCount=$(this).find('.index-btn1 a').length;
            if(listCount>4){
                for(var i=1;i<=ttCount;i++){
                    if(i>3){
                        $(this).find(`.index-btn1 a.note-list:nth-of-type(${i})`).css('display','none')
                    }
                }
                $(this).find('.note-more').css('display','inline-block')
            }else if(listCount<=4){
                $(this).find('.note-more').css('display','none')
            }
//  console.log(listCount)
        })
    })



    var swiper = new Swiper('.swiper-container1', {
        spaceBetween: 30,
        autoplay: 5000,
        autoplayDisableOnInteraction: false
    });

    $("#cookie a").click(function(){
        var time = $("#datetime-picker").val();
        var end_time = $(".end_time").val();
        var id = {$user_id}?{$user_id}:0;

        var aa = $(this).html();
        if(time == ""){
            alert("请先选择出行时间");return;
        }
        if(end_time == ""){
            alert("请先选择结束时间");return;
        }
        if(time >= end_time){
            alert('出行时间不能大于结束时间');return;
        }
        if(aa == "旅游"){
            var a = '3';
            var go_time = $.cookie('time');
            //	$.cookie('cate_id','3');
            //   document.cookie="cate_id="+a;
        }else if(aa == "同城"){
            var a = '1';
            var go_time = $.cookie('time');
            //document.cookie="cate_id="+a;
            //	$.cookie('cate_id','1');
        }else if(aa == "电竞邀约"){
            var a = '2';
            var go_time = $.cookie('time');
        }
//      window.location.href = "/index/personal/photo?id="+id;
        window.location.href = "/index/release/publish?cate_id="+a+"&go_time="+go_time+"&end_time="+end_time;
    });


    $("#searchInput").change(function(){
        like = $("#searchInput").val();
        $.post(
            "/index/index/index_search",
            {like: like},
            function(data){
                window.location.href="/index/index/search_result?data="+data;
            }
        );
    });
    $('.zhe1').click(function(){
        $(".chakan").animate({right:'-4.1rem'}).hide()
        $(".chakan1").show()
        $('.offered').animate({left:'-4.1rem'})
        $('.offered').show()
    })
    $(".offered1").click(function (e) {
        e.preventDefault();
        console.log(1);
        $('.offered').show()
        var tt=$('.offered').css('left');
        if (tt=='-82px'){
            $('.offered').animate({left:'-.8rem'})
            $(this).hide()
        }else {
            $('.offered').animate({left:'-4.1rem'})
            $(this).show()
        }
    })



    $("#datetime-picker").datetimePicker();
    $("#datetime-picker2").datetimePicker();
    $(".time").change(function(){
        var time = $("#datetime-picker").val();
        // alert(time);exit;
        $.cookie("time",time);
    });
    $(".goBack").click(function (e) {
        e.preventDefault();
        $(".indexMessage").hide(400)

    })
    $(".index_message").click(function (e) {
        e.preventDefault();
        $(".indexMessage").show();

    })
    var swiper = new Swiper('.swiper-container', {
        slidesPerView: 3,
        spaceBetween: 5
    });
    /*for(var j=1;j<4;j++){
        var listLength=$(`[data-value='${j}'] .list`).length;
        for(var t=0;t<listLength;t++){
            var slider_length=$(`[data-value='${j}'] .t${t} .swiper-wrapper`).children().length;
            $(`[data-value='${j}'] .t${t} .pic-count`).html(slider_length+"张")
        }
    }*/
    var topHeight=$('.index-top').height();

    $('.personal-list').css({
        position:'absolute',
        top:topHeight,
        left:'0',
        right:'0',
        width:'100%'
    })
    $('.personal-list>div').css({
        position:'fixed',
        top:'0',
        left:'100%',
        right:'-100%'
    })
    $('.personal-list>div.active1').css({
        position:'absolute',
        top:'0',
        left:'0',
        right:'0'
    })
    $(function(){
        var swiper = new Swiper('.swiper-container', {
            slidesPerView: 3,
            spaceBetween: 5
        });
    })
    $(".index-tab").on('click','a',function(e){
        e.preventDefault();
        var count=$(this).attr('href');
        $(this).addClass('active')
            .siblings().removeClass('active');
        $(`[data-value='${count}']`).addClass("active1")
            .siblings().removeClass('active1');
        var activeHeight1=$('.activ1').height();
        $(`[data-value='${count}']`).css({
            position:'absolute',
            top:'0',
            left:'0',
            right:'0'
        }).siblings().css({
            position:'fixed',
            top:'0',
            left:'100%',
            right:'-100%'
        })
    })
    $(".groupb").click(function(){
        var valu = $(this).find("input").val();
        $(".test").css("display","block");
        $(".test").html(valu);
    });
    $(".test").click(function(){
        $(".test").css("display","none");
    });


    /*获取当前位置经纬度*/
    /*function getLocation() {
        if(!$.cookie('index_lng') && !$.cookie('index_lat')){
            var options = {
                enableHighAccuracy : true,
                maximumAge : 1000
            }
            if (navigator.geolocation) {
//                alert(options);
                //浏览器支持geolocation
                navigator.geolocation.getCurrentPosition(onSuccess, onError,options);
            } else {
                //浏览器不支持geolocation
                alert('您的浏览器不支持地理位置定位');
            }
        }
    }
    //成功时
    function onSuccess(position) {
        //返回用户位置
        //经度
        var longitude = position.coords.longitude;
        //纬度
        var latitude = position.coords.latitude;
        $.cookie('index_lng',longitude);
        $.cookie('index_lat',latitude);
//		alert(longitude);
//		alert(latitude);
        //根据经纬度获取地理位置，不太准确，获取城市区域还是可以的
        var map = new BMap.Map("allmap");
        var point = new BMap.Point(longitude, latitude);
        var gc = new BMap.Geocoder();
        gc.getLocation(point, function(rs) {
            var addComp = rs.addressComponents;

            $("#inp").html(addComp.city);
        });
    }
    //失败时
    function onError(error) {
        switch (error.code) {
        case 1:
            alert("位置服务被拒绝，请点击刷新重试！");
            break;
        case 2:
            alert("暂时获取不到位置信息，请点击刷新重试！");
            break;
        case 3:
            alert("获取信息超时，请点击刷新重试！");
            break;
        case 4:
            alert("未知错误，请点击刷新重试！");
            break;
        }
    }
    window.onload = getLocation;*/
</script>
</body>
</html>

